package io.qifan.desktop.client;

import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.WebApplicationType;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.cloud.openfeign.EnableFeignClients;

@SpringBootApplication
@EnableFeignClients(basePackages = "io.qifan.desktop.api")
@Slf4j
public class AppLauncher implements CommandLineRunner {
    public static void main(String[] args) {
        SpringApplicationBuilder springApplicationBuilder = new SpringApplicationBuilder(AppLauncher.class);
        SpringApplication springApplication = springApplicationBuilder.headless(false).build();
        // 不需要启动tomcat，只需要tomcat提供websocket连接
        springApplication.setWebApplicationType(WebApplicationType.NONE);
        ClientApplication.launch(args, ClientApplication.class, springApplication);
    }

    @Override
    public void run(String... args) {
        log.info("容器启动成功");
    }
}
